#ifndef _SHADOWRENDERPASS_H_
#define _SHADOWRENDERPASS_H_

#include <SERender/Renderer/RenderPass/RenderPass.h>
#include <memory>
#include <SERender/Resourses/FrameBuffer.h>
#include <SEngine/Render/Entity/Model.h>
#include <SERender/Entity/Camera.h>
#include <SERender/Entity/Drawable.h>
#include <SERender/Resourses/Material.h>
#include <SERender/Resourses/ShadowMap.h>

namespace SEngine
{
    class ShadowRenderPass : public RenderPass
    {
    public:
        ShadowRenderPass(Renderer & renderer);
        virtual ~ShadowRenderPass() = default;
        virtual void BeginFrame() override;
        virtual void DrawFrame() override;
        virtual void EndFrame() override {}
        std::shared_ptr<Texture> m_directLightDepthTex;
    private:
        std::shared_ptr<Texture> m_pointLightDepthTex;
        std::unique_ptr<FrameBuffer> m_directLightDepthFbo;
        std::unique_ptr<FrameBuffer> m_pointLightDepthFbo;
        std::unique_ptr<FrameBuffer> m_depthFbo;
        Camera m_shadowCamera;
        Drawable m_shadowBoard;
        std::shared_ptr<Material> m_depthMaterial;
        std::shared_ptr<Material> m_depthShadowMaterial;
        std::shared_ptr<Material> m_cubeDepthMaterial;
        std::shared_ptr<Material> m_cubeDepthShadowMaterial;
    };
} // namespace SEngine


#endif